//
//  SupView.m
//  家范
//
//  Created by 吴军虎吴军虎 on 16/4/21.
//  Copyright © 2016年 lanjue. All rights reserved.
//

#import "SupView.h"

@interface SupView(){
    
    NSInteger width;
}

@property(nonatomic,retain)  UIImageView *NaImage;

@end


@implementation SupView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        width = frame.size.width;
        [self createSubView];
    }
    return self;
}

- (void)createSubView {
    
    //黄色底图
    UIView *aView = [[UIView alloc]init];
    aView.backgroundColor = GH;
    aView.userInteractionEnabled=YES;
    [self addSubview:aView];
    [aView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(@0);
        make.left.mas_equalTo(@0);
        make.width.mas_equalTo(self.frame.size.width);
        make.height.mas_equalTo(401.00/2*AUTO_WIDTH);
        //加3/2
        
    }];
    
    //图像
    _TXimage = [[UIImageView alloc]init];
    _TXimage.backgroundColor = GH;
    _TXimage.image = [UIImage imageNamed:@"headBackImage"];
    _TXimage.layer.cornerRadius = 80.00*AUTO_WIDTH/2;
    _TXimage.layer.masksToBounds = YES;
    [aView addSubview:_TXimage];
    [_TXimage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(aView).offset(70.00*AUTO_WIDTH/2);
        make.left.equalTo(aView).offset(250.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(80.00*AUTO_WIDTH,80.00*AUTO_WIDTH ));
        
    }];
    
    self.topHeadView = [[UIImageView alloc]init];
    self.topHeadView.layer.cornerRadius = 80.00*AUTO_WIDTH/2;
    self.topHeadView.layer.masksToBounds = YES;
    self.topHeadView.alpha = 0;
    [aView addSubview:_topHeadView];
    [self.topHeadView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_TXimage);
        make.left.equalTo(_TXimage);
        make.size.equalTo(_TXimage);
    }];
    
    //    //头像小图标
    //    _NaImage=[[UIImageView alloc]init];
    //    _NaImage.image=[UIImage imageNamed:@"header_men"];
    //    [aView addSubview:_NaImage];
    //    [_NaImage mas_makeConstraints:^(MASConstraintMaker *make){
    //
    //        make.top.equalTo(aView.mas_top).offset(72/2 *AUTO_WIDTH);
    //        make.left.equalTo(aView.mas_left).offset(364/2 *AUTO_WIDTH);
    //        make.size.mas_equalTo(CGSizeMake(18.00 *AUTO_WIDTH, 18.00 *AUTO_WIDTH));
    //    }];
    //
    //
    //    //认证
    //    UIImageView *renZhangIM = [[UIImageView alloc]init];
    //    renZhangIM.image = [UIImage imageNamed:@"header_testInfo_yes"];
    //    [aView addSubview:renZhangIM];
    //    [renZhangIM mas_makeConstraints:^(MASConstraintMaker *make) {
    //
    //        make.top.equalTo(_TXimage.mas_bottom).offset(-30.00*AUTO_WIDTH);
    //        make.left.equalTo(_TXimage).offset((80.00*AUTO_WIDTH-55.00*AUTO_WIDTH)/2);
    //        make.size.mas_equalTo(CGSizeMake(55.00*AUTO_WIDTH, 52.00*AUTO_WIDTH));
    //
    //    }];
    
    
    //张三件
    UILabel *YHlabel = [[UILabel alloc]init];
    YHlabel.text = @"张三件";
    YHlabel.textColor=[UIColor whiteColor];
    YHlabel.font = [UIFont systemFontOfSize:17.00*AUTO_WIDTH];
    [aView addSubview:YHlabel];
    [YHlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_TXimage.mas_bottom).offset(50.00*AUTO_WIDTH/2);
        make.left.equalTo(aView).offset(180.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(YHlabel.text.length*17.20*AUTO_WIDTH, 15.00*AUTO_WIDTH));
        
    }];
    
    
    //第一个竖线
    UILabel *line1 = [[UILabel alloc]init];
    line1.backgroundColor  =[UIColor whiteColor];
    [aView addSubview:line1];
    [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_TXimage.mas_bottom).offset(50.00*AUTO_WIDTH/2);
        make.left.equalTo(YHlabel.mas_right).offset(12.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(1.50*AUTO_WIDTH,15.00*AUTO_WIDTH));
        
    }];
    
    
    //离职-随时工作
    UILabel *GSlabel = [[UILabel alloc]init];
    GSlabel.text = @"离职-随时工作";
    GSlabel.textColor=[UIColor whiteColor];
    GSlabel.font = [UIFont systemFontOfSize:17.00*AUTO_WIDTH];
    [aView addSubview:GSlabel];
    [GSlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(_TXimage.mas_bottom).offset(50.00*AUTO_WIDTH/2);
        make.left.equalTo(line1.mas_right).offset(12.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(GSlabel.text.length*17.20*AUTO_WIDTH, 15.00*AUTO_WIDTH));
        
    }];

    
    //现代简约
    UILabel *DDlabe = [[UILabel alloc]init];
    DDlabe.text = @"现代简约";
    DDlabe.textColor=[UIColor whiteColor];
    DDlabe.font = [UIFont systemFontOfSize:15];
    [aView addSubview:DDlabe];
    [DDlabe mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(GSlabel.mas_bottom).offset(20.00*AUTO_WIDTH/2);
        make.left.equalTo(aView.mas_left).offset(190.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(DDlabe.text.length*15.20*AUTO_WIDTH, 15.00*AUTO_WIDTH));
        
    }];
    
    
        //第二个竖线
        UILabel *line2 = [[UILabel alloc]init];
        line2.backgroundColor  =[UIColor whiteColor];
        [aView addSubview:line2];
        [line2 mas_makeConstraints:^(MASConstraintMaker *make) {
    
            make.top.equalTo(GSlabel.mas_bottom).offset(20.00*AUTO_WIDTH/2);
            make.left.equalTo(DDlabe.mas_right).offset(12.00*AUTO_WIDTH/2);
            make.size.mas_equalTo(CGSizeMake(1.50*AUTO_WIDTH,15.00*AUTO_WIDTH));
            
        }];
    
    
    //古典
    UILabel *renlabel=[[UILabel alloc]init];
    renlabel.text=@"古典";
    renlabel.textColor=[UIColor whiteColor];
    renlabel.font=[UIFont systemFontOfSize:15];
    [aView addSubview:renlabel];
    [renlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(GSlabel.mas_bottom).offset(20/2*AUTO_WIDTH);
        make.left.equalTo(line2.mas_left).offset(12/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(renlabel.text.length *15*AUTO_WIDTH, 15 *AUTO_WIDTH));
    }];
    
    
    //第三个竖线
    UILabel *line3 = [[UILabel alloc]init];
    line3.backgroundColor  =[UIColor whiteColor];
    [aView addSubview:line3];
    [line3 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(GSlabel.mas_bottom).offset(20.00*AUTO_WIDTH/2);
        make.left.equalTo(renlabel.mas_right).offset(12.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(1.50*AUTO_WIDTH,15.00*AUTO_WIDTH));
        
    }];
    
    
    //古典
    UILabel *oulabel=[[UILabel alloc]init];
    oulabel.text=@"欧式乡村";
    oulabel.textColor=[UIColor whiteColor];
    oulabel.font=[UIFont systemFontOfSize:15];
    [aView addSubview:oulabel];
    [oulabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(GSlabel.mas_bottom).offset(20/2*AUTO_WIDTH);
        make.left.equalTo(line3.mas_left).offset(12/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(renlabel.text.length *30*AUTO_WIDTH, 15 *AUTO_WIDTH));
    }];

    
    //白色底图
    UIView *bView = [[UIView alloc]init];
    bView.backgroundColor = [UIColor whiteColor];
    bView.userInteractionEnabled=YES;
    bView.layer.cornerRadius=2;
    [self addSubview:bView];
    [bView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(aView.mas_bottom).offset(0.00*AUTO_WIDTH);
        make.left.equalTo(self);
        make.width.mas_equalTo(self.frame.size.width);
        make.height.mas_equalTo(478.00/2*AUTO_WIDTH);
    }];
    
    
    //室内设计师
    UILabel *nameL = [[UILabel alloc]init];
    nameL.text = @"室内设计师";
    nameL.textColor=GH;
    nameL.alpha = 0.7;
    nameL.textAlignment = NSTextAlignmentCenter;
    nameL.font = [UIFont systemFontOfSize:16];
    [bView addSubview:nameL];
    [nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(bView).offset(10.00*AUTO_WIDTH/2);
        make.left.equalTo(bView).offset(36/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(80.00*AUTO_WIDTH, 30.00*AUTO_WIDTH));
        
    }];
    
    
    //第三个竖线
    UILabel *line4 = [[UILabel alloc]init];
    line4.backgroundColor  =GH;
    line4.alpha = 0.7;
    [bView addSubview:line4];
    [line4 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(bView).offset(26.00*AUTO_WIDTH/2);
        make.left.equalTo(nameL.mas_right).offset(12.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(1.50*AUTO_WIDTH,15.00*AUTO_WIDTH));
        
    }];
    
    
    //建筑设计师
    UILabel *jianlabel = [[UILabel alloc]init];
    jianlabel.text = @"建筑设计师";
    jianlabel.textColor=GH;
    jianlabel.alpha = 0.7;
    jianlabel.textAlignment = NSTextAlignmentCenter;
    jianlabel.font = [UIFont systemFontOfSize:16];
    [bView addSubview:jianlabel];
    [jianlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(bView).offset(10.00*AUTO_WIDTH/2);
        make.left.equalTo(line4.mas_right).offset(12/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(80.00*AUTO_WIDTH, 30.00*AUTO_WIDTH));
        
    }];

    
    //第一个横线
    UIImageView *imageViewLin = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"xu"]];
    imageViewLin.backgroundColor = [UIColor whiteColor];
    [self addSubview:imageViewLin];
    [imageViewLin mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(nameL.mas_bottom).offset(10.00*AUTO_WIDTH/2);
        make.left.equalTo(bView).offset(29.00*AUTO_WIDTH/2);
        make.right.equalTo(bView.mas_right).offset(-29.00*AUTO_WIDTH/2);
        make.height.mas_equalTo(1);
        
    }];
    
    
    
    
    UIImageView *imageViewLin4 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"xu"]];
    imageViewLin4.backgroundColor = [UIColor whiteColor];
    [self addSubview:imageViewLin4];
    [imageViewLin4 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(imageViewLin.mas_bottom).offset(142.00*AUTO_WIDTH/2);
        make.left.equalTo(bView).offset(29.00*AUTO_WIDTH/2);
        make.right.equalTo(bView.mas_right).offset(-29.00*AUTO_WIDTH/2);
        make.height.mas_equalTo(1);
        
    }];
    
    
    UIImageView *imageViewLin11 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shu"]];
    imageViewLin11.backgroundColor = [UIColor whiteColor];
    [bView addSubview:imageViewLin11];
    [imageViewLin11 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(imageViewLin.mas_bottom).offset(10.00*AUTO_WIDTH/2);
        make.bottom.equalTo(imageViewLin4.mas_bottom).offset(-10.00*AUTO_WIDTH/2);
        make.left.equalTo(bView.mas_left).offset(170/2 *AUTO_WIDTH);
        make.width.mas_equalTo(1);
        
    }];
    
    
    UIImageView *imageViewLin21 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shu"]];
    imageViewLin21.alpha = 1;
    imageViewLin21.backgroundColor = [UIColor whiteColor];
    [bView addSubview:imageViewLin21];
    [imageViewLin21 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(imageViewLin.mas_bottom).offset(10.00*AUTO_WIDTH/2);
        make.bottom.equalTo(imageViewLin4.mas_bottom).offset(-10.00*AUTO_WIDTH/2);
        make.left.equalTo(imageViewLin11.mas_left).offset(170/2 *AUTO_WIDTH);
        make.width.mas_equalTo(1);
        
    }];
    
    
    UIImageView *imageViewLin2 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shu"]];
    imageViewLin2.alpha = 1;
    imageViewLin2.backgroundColor = [UIColor whiteColor];
    [bView addSubview:imageViewLin2];
    [imageViewLin2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(imageViewLin.mas_bottom).offset(10.00*AUTO_WIDTH/2);
        make.bottom.equalTo(imageViewLin4.mas_bottom).offset(-10.00*AUTO_WIDTH/2);
        make.left.equalTo(imageViewLin21.mas_left).offset(170/2 *AUTO_WIDTH);
        make.width.mas_equalTo(1);
        
    }];
    
    //杭州的上图
    UIImageView *adressIM = [[UIImageView alloc]init];
    adressIM.image = [UIImage imageNamed:@"find_RMB"];
    [bView addSubview:adressIM];
    [adressIM mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(imageViewLin.mas_bottom).offset(35.00*AUTO_WIDTH/2);
        make.left.equalTo(bView).offset(80.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(18.00*AUTO_WIDTH, 18.00*AUTO_WIDTH));
    }];
    
    
    //杭州
    UILabel *addressL = [[UILabel alloc]init];
    addressL.text = @"30-50";
    addressL.textColor = HS;
    addressL.font = [UIFont systemFontOfSize:12];
    addressL.textAlignment=NSTextAlignmentCenter;
    [bView addSubview:addressL];
    [addressL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(adressIM.mas_bottom).offset(18.00*AUTO_WIDTH/2);
        make.centerX.equalTo(adressIM).offset(3.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(addressL.text.length*18.00*AUTO_WIDTH, 15.00*AUTO_WIDTH));
        
    }];
    
    //1-3年的上图
    UIImageView *workIM = [[UIImageView alloc]init];
    workIM.image = [UIImage imageNamed:@"find_exp"];
    [bView addSubview:workIM];
    [workIM mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(imageViewLin.mas_bottom).offset(35.00*AUTO_WIDTH/2);
        make.left.equalTo(imageViewLin21).offset(72.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(18.00*AUTO_WIDTH, 18.00*AUTO_WIDTH));
    }];
    
    //1-3年
    UILabel *workL = [[UILabel alloc]init];
    workL.text = @"1-3年";
    workL.textColor = HS;
    workL.font = [UIFont systemFontOfSize:12];
    workL.textAlignment=NSTextAlignmentCenter;
    [bView addSubview:workL];
    [workL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(workIM.mas_bottom).offset(18.00*AUTO_WIDTH/2);
        make.centerX.equalTo(workIM).offset(1.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(workL.text.length*18.00*AUTO_WIDTH, 15.00*AUTO_WIDTH));
        
    }];
    
    //999上图
    UIImageView *peopleIM = [[UIImageView alloc]init];
    peopleIM.image = [UIImage imageNamed:@"find_pepNum"];
    [bView addSubview:peopleIM];
    [peopleIM mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(imageViewLin.mas_bottom).offset(35.00*AUTO_WIDTH/2);
        make.left.equalTo(imageViewLin11).offset(72.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(18.00*AUTO_WIDTH, 18.00*AUTO_WIDTH));
    }];
    
    
    //999人
    UILabel *peopleL = [[UILabel alloc]init];
    peopleL.text = @"999人";
    peopleL.textColor = HS;
    peopleL.textAlignment=NSTextAlignmentCenter;
    peopleL.font = [UIFont systemFontOfSize:12];
    [bView addSubview:peopleL];
    [peopleL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(peopleIM.mas_bottom).offset(18.00*AUTO_WIDTH/2);
        make.left.equalTo(imageViewLin11).offset(42.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(50.00*AUTO_WIDTH, 16.00*AUTO_WIDTH));
        
    }];
    
    
    //999上图
    UIImageView *nanImage = [[UIImageView alloc]init];
    nanImage.image = [UIImage imageNamed:@"di"];
    [bView addSubview:nanImage];
    [nanImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(imageViewLin.mas_bottom).offset(35.00*AUTO_WIDTH/2);
        make.right.equalTo(bView).offset(-64.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(18.00*AUTO_WIDTH, 18.00*AUTO_WIDTH));
    }];
    
    
    //杭州
    UILabel *nanL = [[UILabel alloc]init];
    nanL.text = @"杭州";
    nanL.textColor = HS;
    nanL.textAlignment=NSTextAlignmentCenter;
    nanL.font = [UIFont systemFontOfSize:12];
    [bView addSubview:nanL];
    [nanL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(nanImage.mas_bottom).offset(18.00*AUTO_WIDTH/2);
        make.left.equalTo(imageViewLin2).offset(18.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(50.00*AUTO_WIDTH, 16.00*AUTO_WIDTH));
        
    }];
    
    
    //别具一格
    UIButton *biebtn=[[UIButton alloc]init];
    biebtn.backgroundColor=GH;
    [biebtn setTitle:@"别具一格" forState:UIControlStateNormal];
    [biebtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    biebtn.titleLabel.font=[UIFont systemFontOfSize:13];
    
    biebtn.layer.cornerRadius=3;
    [bView addSubview:biebtn];
    [biebtn mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(imageViewLin4).offset(36/2 *AUTO_WIDTH);
        make.left.equalTo(bView.mas_left).offset(36/2 *AUTO_WIDTH);
        make.size.mas_offset(CGSizeMake(60 *AUTO_WIDTH, 20 *AUTO_WIDTH));
    }];
    
    //匠心独具
    UIButton *xinbtn=[[UIButton alloc]init];
    xinbtn.backgroundColor=GH;
    [xinbtn setTitle:@"匠心独具" forState:UIControlStateNormal];
    [xinbtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    xinbtn.titleLabel.font=[UIFont systemFontOfSize:13];
    xinbtn.layer.cornerRadius=3;
    [bView addSubview:xinbtn];
    [xinbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(imageViewLin4).offset(36/2 *AUTO_WIDTH);
        make.left.equalTo(biebtn.mas_right).offset(12/2 *AUTO_WIDTH);
        make.size.mas_offset(CGSizeMake(60 *AUTO_WIDTH, 20 *AUTO_WIDTH));
    }];
    
    //认真负责
    UIButton *renbtn=[[UIButton alloc]init];
    renbtn.backgroundColor=GH;
    [renbtn setTitle:@"认真负责" forState:UIControlStateNormal];
    [renbtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    renbtn.titleLabel.font=[UIFont systemFontOfSize:13];
    renbtn.layer.cornerRadius=3;
    [bView addSubview:renbtn];
    [renbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(imageViewLin4).offset(36/2 *AUTO_WIDTH);
        make.left.equalTo(xinbtn.mas_right).offset(12/2 *AUTO_WIDTH);
        make.size.mas_offset(CGSizeMake(60 *AUTO_WIDTH, 20 *AUTO_WIDTH));
    }];
    
    //诙谐幽默
    UIButton *huibtn=[[UIButton alloc]init];
    huibtn.backgroundColor=GH;
    [huibtn setTitle:@"诙谐幽默" forState:UIControlStateNormal];
    [huibtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    huibtn.titleLabel.font=[UIFont systemFontOfSize:13];
    huibtn.layer.cornerRadius=3;
    [bView addSubview:huibtn];
    [huibtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(imageViewLin4).offset(36/2 *AUTO_WIDTH);
        make.left.equalTo(renbtn.mas_right).offset(12/2 *AUTO_WIDTH);
        make.size.mas_offset(CGSizeMake(60 *AUTO_WIDTH, 20 *AUTO_WIDTH));
    }];
    
}

@end
